import { createRouter, createWebHistory } from 'vue-router'
import LoginView from '@/views/login/index.vue'
import HomeView from '@/views/home/index.vue'
import FenView from '@/views/fen/index.vue'
import ShopView from '@/views/shop/index.vue'
import MyView from '@/views/my/index.vue'
import XiangView from '@/views/xiang/index.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    //重定向
    {path:'/',redirect:'/home'},
    {
      path: '/home',
      name: 'home',
      component: HomeView,
    },
    {
      path: '/login',
      name: 'login',
      component: LoginView,
    },
    {
      path: '/fen',
      name: 'fen',
      component: FenView,
    },
    {
      path: '/shop',
      name: 'shop',
      component: ShopView,
    },
    {
      path: '/my',
      name: 'my',
      component: MyView,
    },
    {
      path: '/xiang/:id',
      name: 'xiang',
      component: XiangView,
    },
  ],
})

export default router
